use resturant;

enum IpAddrKind {
    V4,
    V6,
}

enum Message {
    Quit,
    Move { x: i32, y: i32 },
    Write(String),
    ChangeColor(i32, i32, i32),
}

struct IpAddr {
    kind: IpAddrKind,
    addr: String,
}

#[derive(Debug)] // so we can inspect the state in a minute
enum UsState {
    Alabama,
    Alaska,
    // --snip--
}

enum Coin {
    Penny,
    Nickel,
    Dime,
    Quarter(UsState),
}

fn add_fancy_hat() {
    println!("add_fancy_hat() invoke !")
}

fn remove_fancy_hat() {
    println!("remove_fancy_hat() invoke !")
}

fn reroll() {
    println!("reroll() invoke !")
}

fn value_in_cents(coin: Coin) -> u8 {
    match coin {
        Coin::Penny => 1,
        Coin::Nickel => 5,
        Coin::Dime => 10,
        Coin::Quarter(state) => {
            println!("State quarter from {:?}!", state);
            25
        }
    }
}

fn main() {
    let v4 = IpAddrKind::V4;
    let v6 = IpAddrKind::V6;
    let home = IpAddr {
        kind: v4,
        addr: String::from("127.0.0.1"),
    };
    let loopback = IpAddr {
        kind: v6,
        addr: String::from("::1"),
    };

    println!("Hello, world!");

    let coin = Coin::Quarter(UsState::Alabama);

    value_in_cents(coin);

    let dice_roll = 9;

    match dice_roll {
        3 => add_fancy_hat(),
        7 => remove_fancy_hat(),
        _ => reroll(),
    }

    add_to_waitlist();

}
